<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.org/rich"
	template="../include/template.xhtml">

	<ui:define name="content">
		<style type="text/css">
<!--
.inputClass {
	border: 1px solid #6699CC;
	width: 300px;
	margin-left: 4px;
}
-->
</style>
		<link type="text/css" rel="stylesheet" href="../css/global.css" />
		<br />
		<h:graphicImage value="../images/provider.bmp"></h:graphicImage>
		<h:outputText value="短消息" class="strong"></h:outputText>
		<rich:separator lineType="double" height="2px" />
		<rich:spacer width="30px"></rich:spacer>
		<s:div styleClass="right_center">
			<s:link value="收件箱" view="/passport/index.xhtml" />
			<h:outputText
				value=" --> #{messageIndexAction.messageType}[#{messageIndexAction.messages.size()}条]" />
		</s:div>

		<s:div styleClass="right_center">

			<rich:dataGrid id="messageGrid"
				value="#{messageIndexAction.messages}" var="msg" elements="8"
				columns="1" style="width:100%;">
				<f:facet name="header">
					<h:panelGrid columns="3" style="width:100%;">
						<h:outputText value="标题" />
						<h:panelGrid columns="2" style="width:250px;float:right;">
							<h:outputText value="来自" />
							<h:outputText value="时间" />
						</h:panelGrid>
					</h:panelGrid>
				</f:facet>
				<a:form>
					<rich:togglePanel switchType="client" id="togPanel"
						stateOrder="first,second,third">
						<f:facet name="first">
							<ui:include src="/include/message/firstLine.xhtml">
								<ui:param name="next" value="second" />
							</ui:include>
						</f:facet>
						<f:facet name="second">
							<s:div>
								<ui:include src="/include/message/firstLine.xhtml">
								</ui:include>
								<h:panelGrid columns="2">
									<h:outputText value="发信人:" />
									<h:outputText value="#{msg.sender.nickName}" />
									<h:outputText value="内容 :" />
									<h:outputText value="#{msg.content}" />
								</h:panelGrid>
							</s:div>
						</f:facet>
						<f:facet name="third">
							<s:div>
								<ui:include src="/include/message/firstLine.xhtml" />
								<a:region>
									<h:panelGrid columns="2">
										<h:outputText value="标题" />
										<h:inputText value="#{message.topic}" class="inputClass" />
										<h:outputText value="内容 :" />
										<h:inputTextarea value="#{message.content}" rows="4"
											class="inputClass" />
									</h:panelGrid>
									<a:commandButton value="回复" styleClass="gbutton"
										reRender="togPanel"
										action="#{messageIndexAction.replyMessage(message,msg.sender)}">
									</a:commandButton>
								</a:region>
							</s:div>
						</f:facet>

					</rich:togglePanel>
				</a:form>
				<f:facet name="footer">
					<a:form>
						<rich:datascroller for="messageGrid"
							rendered="#{messageIndexAction.messages.size()>8}" maxPages="20" />
					</a:form>
				</f:facet>
			</rich:dataGrid>
		</s:div>
	</ui:define>
</ui:composition>
